<?php
namespace app\index\controller;

class About extends BaseHome
{
    public function index()
    {
        $lbp=db("lb")->where("fid=6")->find();
        $this->assign("lbp",$lbp);
        
        $lbm=db("lb")->where("fid=7")->find();
        $this->assign("lbm",$lbm);
        
        $re=db("about")->where("id=1")->find();
        $this->assign("re",$re);
        
        return \view('index');
    }
    public function speak()
    {
        $lbp=db("lb")->where("fid=6")->find();
        $this->assign("lbp",$lbp);
        
        $lbm=db("lb")->where("fid=7")->find();
        $this->assign("lbm",$lbm);
        
        $re=db("about")->where("id=2")->find();
        $this->assign("re",$re);
        
        return \view('speak');
    }
    public function honor()
    {
        $lbp=db("lb")->where("fid=6")->find();
        $this->assign("lbp",$lbp);
        
        $lbm=db("lb")->where("fid=7")->find();
        $this->assign("lbm",$lbm);
        
        $res=db("honor")->where("status=1")->order("sort asc")->paginate(6);
        $this->assign("res",$res);
        
        $page=$res->render();
        $this->assign("page",$page);
        
        return \view('honor');
    }
    public function detail()
    {
        $lbp=db("lb")->where("fid=6")->find();
        $this->assign("lbp",$lbp);
        
        $lbm=db("lb")->where("fid=7")->find();
        $this->assign("lbm",$lbm);
        
        $id=\input('id');
        $re=db("honor")->where("id=$id")->find();
        $this->assign("re",$re);
        
        db("honor")->where("id=$id")->setInc("browse",1);
        
        //上一篇
        $pre=db('honor')->where("id<$id")->order("id desc")->limit("1")->find();
        $this->assign("pre",$pre);
        
        //下一篇
        $nre=db('honor')->where("id>$id")->order("id asc")->limit("1")->find();
        $this->assign("nre",$nre);
        
        return \view('detail');
    }
    public function ideal()
    {
        $lbp=db("lb")->where("fid=6")->find();
        $this->assign("lbp",$lbp);
        
        $lbm=db("lb")->where("fid=7")->find();
        $this->assign("lbm",$lbm);
        
        $re=db("about")->where("id=3")->find();
        $this->assign("re",$re);
        
        return \view('ideal');
    }
    public function organize()
    {
        $lbp=db("lb")->where("fid=6")->find();
        $this->assign("lbp",$lbp);
        
        $lbm=db("lb")->where("fid=7")->find();
        $this->assign("lbm",$lbm);
        
        $res=db("t_type")->order("t_sort asc")->select();
        $this->assign("res",$res);
        
        return \view('organize');
    }



    public function team()
    {

        $lbp=db("lb")->where("fid=16")->order("sort asc")->find();
        $this->assign("lbp",$lbp);

        $lbm=db("lb")->where("fid=17")->order("sort asc")->find();
        $this->assign("lbm",$lbm);

        $id=\input('id');
        //团队风采
        $re=db("team")->where("id=$id")->find();
        $this->assign("re",$re);

//        db("team")->where("id=$id")->setInc("browse",1);

        //上一篇
        $pre=db('team')->where("id<$id")->order("id desc")->limit("1")->find();
        $this->assign("pre",$pre);

        //下一篇
        $nre=db('team')->where("id>$id")->order("id asc")->limit("1")->find();
        $this->assign("nre",$nre);

        return \view('team');
    }
    
    
    
    
    
    
    
}